//
//  ViewController.m
//  首页
//
//  Created by DYS on 15/12/28.
//  Copyright © 2015年 DYS. All rights reserved.
//

#import "ViewController.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
#import "HeroSegmentView.h"
#import "ThirdViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    
    FirstViewController *first = [[FirstViewController alloc] init];
    first.title = @"推荐";
    SecondViewController *second = [[SecondViewController alloc] init];
    second.title = @"发现";
    
    ThirdViewController *third = [[ThirdViewController alloc] init];
    third.title = @"呵呵";
    
    NSArray *arr = @[first,second,third];
    
    HeroSegmentView *segmentView = [[HeroSegmentView alloc] initWithFrame:self.view.bounds];
    [segmentView setViewControllers:arr owner:self];
    [self.view addSubview:segmentView];
    
    UIView *seg = [segmentView topControlViewWithFrame:CGRectMake(0, 0, 120, 30)];
    self.navigationItem.titleView = seg;
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
